cnum   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 14
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Function

Rating   Name   Duplication   Size   Complexity  
A evaluate 0 5 1
1 1
import VERSION from './version'
2 1
import Lexer from './Lexer'
3 1
import Parser from './Parser'
4
5
/**
6
 * @class Comfortably Numbers
7
 * @name cnum
8
 */
9
class cnum {
10
  static get version(): string {
11 1
    return VERSION
12
  }
13
14
  static evaluate(expression: string): string {
15 2
    const lexer = new Lexer(expression)
16 2
    const parser = new Parser(lexer.lex())
17 2
    return parser.toString()
18
  }
19
}
20
21 1
export default cnum
22 3
export { Rat, floatToRat, parseRat } from './Rat'
23
export { Polyrat } from './Polyrat'
24